package  com.cnn.function.stock.pojo.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import  com.cnn.function.stock.mapper.StockOutDetailsMapper;
import  com.cnn.function.stock.pojo.StockOutDetails;
import  com.cnn.function.stock.pojo.StockOutDetailsExample;
import  com.cnn.function.stock.service.StockOutDetailsService;

@Service
public class StockOutDetailsServiceImpl implements StockOutDetailsService {

	@Resource
	private StockOutDetailsMapper stockOutDetailsMapper;

	@Override
	public void addStockOutDetails(StockOutDetails stockOutDetails) {
		stockOutDetailsMapper.insert(stockOutDetails);
	}

	@Override
	public void updateStockOutDetails(StockOutDetails stockOutDetails) {
		stockOutDetailsMapper.updateByPrimaryKeySelective(stockOutDetails);
	}

	@Override
	public void deleteStockOutDetails(Long id) {
		stockOutDetailsMapper.deleteByPrimaryKey(id);
	}

	@Override
	public List<StockOutDetails> getStockOutDetails() {
		return stockOutDetailsMapper.selectByExample(new StockOutDetailsExample());
	}

	@Override
	public StockOutDetails getStockOutDetailsById(Long id) {
		return stockOutDetailsMapper.selectByPrimaryKey(id);
	}
}
